package main

import "fmt"

func main()  {
	/*var a[4]int
	var b=[4]int{}
	var c=[4]int{1,2,3,4}
	var d=[4]int{1,2}
	e:=[4]string{0:"memeda",1:"王二狗",2:"30"} //类型必须一致
	f:=[...]int{}
	fmt.Println(a,b,c,d,e,f)

	var n[10]int //n是一个长度为10的数组
	var i,j int
	//为数组n初始化元素
	for i=0;i<10;i++ {
		n[i]=i+100
	}
	//输出每个数组元素的值
	for j=0;j<10;j++{
		fmt.Printf("Element[%d]=%d\n",j,n[j])
	}
*/
	a:=10
	b:=20
	fmt.Println(a)
	fmt.Println(b)
	a=100
	fmt.Println(a)
	var arr1 [5] int
	fmt.Println(arr1)
	fmt.Println(len(arr1)) //打印数组的长度

	arr1[0]=1
	arr1[1]=2
	arr1[2]=3
	arr1[3]=4
	arr1[4]=5
	fmt.Println(arr1)

	a1:=[...]float64{67.7,89.8,21,78}
	for i:=0;i<len(a1);i++{
		fmt.Printf("数组%d为:%f\n",i,a1[i])
	}

	a2:=[...]float64{67.7,89.8,21,78}
	sum:=float64(0)
	for i,v:=range a2{
		fmt.Println(i,v)
		sum+=v
	}
	fmt.Println(sum)
	k:=[...]int{1:100,4:200,9:300}
	fmt.Println(k)


	g:=[...]int{1,2,3,4,5,6}
	fmt.Println(g)

	for

}
